<template>
  <div class="tab-bar">
    <tabbar :list="tabs" />
  </div>
</template>

<script>
import Tabbar from './tabbar.vue'
import routes from '@/router/routes'
export default {
  name: 'MyTabbar',
  data() {
    return {
      // tabs: [
      //   {
      //     icon: 'home-o',
      //     text: '首页',
      //     pagePath: '/home',
      //   },
      //   {
      //     icon: 'user-o',
      //     text: '我的',
      //     pagePath: '/mine',
      //   },
      // ],
    }
  },
  computed: {
    tabs() {
      return routes.filter(route => route.meta?.inTabbar).map(route => ({
        icon: route.meta.icon,
        text: route.meta.title,
        pagePath: route.path,
      }))
    },
  },
  components: {
    Tabbar,
  },
}
</script>

<style lang="less" scoped>

</style>
